﻿@model SimpleChatDal.Message

<tr @if (Model != null) {
    @:data-pkey="@Model.MessageID"
}>
    <td>
        @Html.DropDownList("ChatRoomID", String.Empty)
        @Html.ValidationMessageFor(model => model.ChatRoomID)
    </td>
    <td>
        @Html.EditorFor(model => model.MessageText)
        @Html.ValidationMessageFor(model => model.MessageText)
    </td>
    <td>
        @Html.EditorFor(model => model.MessageDate)
        @Html.ValidationMessageFor(model => model.MessageDate)
    </td>
    <td>
        @Html.EditorFor(model => model.Author)
        @Html.ValidationMessageFor(model => model.Author)
    </td>
    <td>
        @Html.EditorFor(model => model.AuthorIP)
        @Html.ValidationMessageFor(model => model.AuthorIP)
    </td>
    <td>
@if (ViewContext.RouteData.Values["Action"].ToString() == "Edit") {
        <button class="editRow">Save</button><button class="cancelEditRow">Cancel</button>
} else {
        <button class="createRow">Create</button><button class="cancelCreateRow">Cancel</button>
}
    </td>
</tr>
